<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<form class="mui-input-group">
				<div class="mui-input-row">
					<label>username</label>
					<input type="text" class="mui-input-clear" placeholder="用户名" name="username" v-model="user.username">
					
					<label>password</label>
					<input type="password" class="mui-input-clear" placeholder="密码" name="password" v-model="user.password">
					
					
					<input type="button" value="提交" v-on:click="fun1()" />
					
				</div>
			</form>
		</div>
		
		<script src="../js/vuejs-2.5.16.js" type="text/javascript" charset="utf-8"></script>
		
		<script type="text/javascript">
			const vue = new Vue({
				el: "#app",
				data:{
					// 将数据封装到data中
					user:{
						username:"",
						password:""
					}
				},
				methods:{
					fun1:function(){
						alert("username:"+this.user.username+",password:"+this.user.password)
					}
				}
			})
		</script>
		
	</body>
</html>
